package id.co.rho.scoring.cid.client.helper;

import com.extjs.gxt.ui.client.data.BaseTreeModel;
import com.google.gwt.user.client.ui.AbstractImagePrototype;

/**
 * Created by IntelliJ IDEA.
 * User: User3
 * Date: 20/07/11
 * Time: 15:49
 *
 * @author : Frizky
 * @email : frizkey@gmail.com
 * To change this template use File | Settings | File Templates.
 */
public class ModelMenu extends AbstractModelMenu {


    public ModelMenu() {
        set("id", ID++);
    }

    public ModelMenu(String name) {
        set("id", ID++);
        set("name", name);
    }

    public ModelMenu(String name, AbstractImagePrototype image) {
        set("id", ID++);
        set("name", name);
        set("image", image);
    }

    public ModelMenu(String name, BaseTreeModel[] children) {
        this(name);
        for (int i = 0; i < children.length; i++) {
            add(children[i]);
        }
    }

    public ModelMenu(String name, AbstractImagePrototype image, BaseTreeModel[] children) {
        this(name, image);
        for (int i = 0; i < children.length; i++) {
            add(children[i]);
        }
    }

}
